package com.mephi.oshs.presenter;

import com.mephi.oshs.view.api.IExploreView;
import com.mephi.oshs.view.api.IOshsView;
import com.mephi.oshs.view.api.ISearchView;

public abstract class AbstractPresenter implements IPresenter {

    private static final PresenterManager MANAGER = PresenterManager.getInstance();

    protected IOshsView getOshsView() {
        return (IOshsView) MANAGER.getViewManager().getViewById(IOshsView.ID);
    }

    protected IExploreView getExploreView() {
        return (IExploreView) MANAGER.getViewManager().getViewById(IExploreView.ID);
    }

    protected ISearchView getSearchView() {
        return (ISearchView) MANAGER.getViewManager().getViewById(ISearchView.ID);
    }

    protected OshsPresenter getOshsPresenter() {
        return (OshsPresenter) MANAGER.getPresenterById(IOshsView.ID);
    }

    protected ExplorePresenter getExplorePresenter() {
        return (ExplorePresenter) MANAGER.getPresenterById(IExploreView.ID);
    }

    protected SearchPresenter getSearchPresenter() {
        return (SearchPresenter) MANAGER.getPresenterById(ISearchView.ID);
    }
}
